package com.balabala.gym_user.mapper;


import com.balabala.gym_user.pojo.dto.VenuesAppQueryDto;
import com.balabala.gym_user.pojo.dto.VenuesQueryDto;
import com.balabala.gym_user.pojo.entity.Venues;
import com.balabala.gym_user.pojo.vo.VenuesAllVo;
import com.balabala.gym_user.pojo.vo.VenuesDetailsVo;
import com.balabala.gym_user.pojo.vo.VenuesQueryVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;


import java.util.List;

/**
 * @Author 何涛
 * @Date: 2023/05/01/ 16:47
 * @description 场馆mapper
 */

public interface VenuesMapper extends BaseMapper<Venues> {

    /**
     * 根据场馆名模糊查询
     * @param venuesQueryDto
     * @return
     */

    List<VenuesQueryVo> findName(VenuesQueryDto venuesQueryDto);


    /**
     * 查询所有的场馆
     * @return
     */
    @Select("select v.id , v.`name` , v.phone ,v.address ,v.state from tb_venues v")
    List<VenuesAllVo> findAllByVenues();

    /**
     * 根据场馆名称模糊查询
     * @param venuesAppQueryDto
     * @return
     */
    List<VenuesAllVo> findByName(VenuesAppQueryDto venuesAppQueryDto);


    @Select("select  v.introduce , v.image, v.phone ,v.address, v.vecomment from tb_venues  v")
    List<VenuesDetailsVo> findDetails();

}
